package com.woniuxy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.entity.Movie;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

public interface MovieMapper extends BaseMapper<Movie> {
    @Select("select * from sys_movie  WHERE new_category = #{new_category} LIMIT 4")
    List<Movie> ByNew(@Param("new_category") int new_category);
    @Select("SELECT m.* FROM sys_movie m,sys_movie_to_category mc WHERE m.movie_id = mc.movie_id and mc.movie_category_id=#{categoryId} and m.new_category =#{n}")
    List<Movie> ByCategoryId(@Param("categoryId") Integer categoryId,@Param("n") int n);
    @Select("select * from sys_movie where new_category =#{n}")
    List<Movie> all(@Param("n") int n);

    @Select("select * from sys_movie LIMIT 10")
    List<Movie> Byrunk();
}
